import 'package:flutter/material.dart';
import '../chat/widgets/widgets.dart';

enum ChatMsgType { timeline, text, image }

class ChatModel {
  String? avater;
  String? msg;

  bool isSelf = false;
  ChatMsgType msgType = ChatMsgType.text;

  Widget get itemCell {
    switch (msgType) {
      case ChatMsgType.text:
        return ChatTextCell(
          md: this,
        );
      case ChatMsgType.image:
        return ChatImageCell(md: this);
      case ChatMsgType.timeline:
        return ChatTimeline(md: this);
      default:
        return ChatTextCell(
          md: this,
        );
    }
  }
}
